package controler;

import java.awt.Cursor;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JPanel;

import model.*;

public class ActionZoom implements MouseListener 
{
	private Panneau_carte carte;
	private JPanel img;
	
	public ActionZoom(Panneau_carte carte, JPanel img) 
	{
		this.carte = carte;
		this.img = img;
	}

	@Override
	public void mouseClicked(MouseEvent arg0) 
	{
		if(this.img instanceof Panneau_loupe_moins)		
			this.carte.dezoomer();
		if(this.img instanceof Panneau_loupe_plus)		
			this.carte.zoomer();
	}

	@Override
	public void mouseEntered(MouseEvent e) 
	{
		if (e.getPoint() == null)
			this.img.setCursor(Cursor.getDefaultCursor());
		else
			this.img.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR) );	
		
	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

}
